package com.wyj.wuliwuli.entity.mapper;

import com.wyj.wuliwuli.entity.WuliNotice;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.data.jpa.repository.JpaRepository;

import java.util.List;

/**
 * @Version 1.0
 * @Description
 */
public interface WuliNoticeMapper extends JpaRepository<WuliNotice, Long>  {

    /**
     * 查询用户的全部未读
     * @param user_id
     * @param read
     * @return
     */
    List<WuliNotice> findByUser_IdAndIsReadIsNot(Long user_id, Integer read);

    /**
     * 分页查询用户未读
     * @param read
     * @param user_id
     * @param pageable
     * @return
     */
    Page<WuliNotice> findByIsReadIsNotAndUser_Id(Integer read, Long user_id, Pageable pageable);
}
